package com.craney.testTimer
{
	import flash.events.TimerEvent;
	import flash.utils.Timer;
	
	public class TestTimer
	{
		static public var TOTALID:uint = 1;
		
		public const id:uint = TOTALID++;
		
		public function TestTimer(inter:uint=1000)
		{
			var myTimer:Timer = new Timer(inter, 0);
			
			myTimer.addEventListener(TimerEvent.TIMER, per500ms);
			myTimer.addEventListener(TimerEvent.TIMER_COMPLETE, finished);
			
			myTimer.start();
			
		}

		private function per500ms(event:TimerEvent):void
		{
			trace("id=" + id + "This is " + i++ + "  times.");
			trace("tick:" + event.target.currentCount);
		}
		
		private function finished(evnet:TimerEvent):void
		{
			trace("Time up!");
		}
		
		private var i:int = 1;


	}
}